Remove gtk_widget_hide_all()
authorMatthias Clasen <mclasen@redhat.com>
Tue, 19 Oct 2010 17:31:38 +0000 (19:31 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 19 Oct 2010 17:31:38 +0000 (19:31 +0200)
it's useless and a trap for programmers

https://bugzilla.gnome.org/show_bug.cgi?id=438318

gtk/gtkcombobox.c
gtk/gtkcontainer.c
gtk/gtkfilechooserbutton.c
gtk/gtkmenu.c
gtk/gtkmenuitem.c
gtk/gtksocket.c
gtk/gtktoolbar.c
gtk/gtkwidget.c
gtk/gtkwidget.h

index ea98ef15e97089fa725121ac80712b0bb2562865..09e58999b077ce61f2eac67f6a2130bb391f437b 100644 (file)
@@ -2343,7 +2343,7 @@ gtk_combo_box_popdown (GtkComboBox *combo_box)
     return;
 
   gtk_device_grab_remove (priv->popup_window, priv->grab_pointer);
-  gtk_widget_hide_all (priv->popup_window);
+  gtk_widget_hide (priv->popup_window);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->button),
                                 FALSE);
 
index 4ed90719084cc1215604a2f6a861a02d99ea606b..2a2555ffdb2f38bb3af1a1d17bc12533b659cf22 100644 (file)
@@ -316,7 +316,6 @@ static gboolean gtk_container_focus_move           (GtkContainer      *container
 static void     gtk_container_children_callback    (GtkWidget         *widget,
                                                    gpointer           client_data);
 static void     gtk_container_show_all             (GtkWidget         *widget);
-static void     gtk_container_hide_all             (GtkWidget         *widget);
 static gint     gtk_container_draw                 (GtkWidget         *widget,
                                                     cairo_t           *cr);
 static void     gtk_container_map                  (GtkWidget         *widget);
@@ -448,7 +447,6 @@ gtk_container_class_init (GtkContainerClass *class)
   widget_class->destroy = gtk_container_destroy;
   widget_class->compute_expand = gtk_container_compute_expand;
   widget_class->show_all = gtk_container_show_all;
-  widget_class->hide_all = gtk_container_hide_all;
   widget_class->draw = gtk_container_draw;
   widget_class->map = gtk_container_map;
   widget_class->unmap = gtk_container_unmap;
@@ -3031,18 +3029,6 @@ gtk_container_show_all (GtkWidget *widget)
   gtk_widget_show (widget);
 }
 
-static void
-gtk_container_hide_all (GtkWidget *widget)
-{
-  g_return_if_fail (GTK_IS_CONTAINER (widget));
-
-  gtk_widget_hide (widget);
-  gtk_container_foreach (GTK_CONTAINER (widget),
-                        (GtkCallback) gtk_widget_hide_all,
-                        NULL);
-}
-
-
 static void
 gtk_container_draw_child (GtkWidget *child,
                          gpointer   client_data)
index f2af98a5ed7556d9bc9988febe8d04fd398e52ad..b954f398ee49bdde2748533945fa2546737a8ec8 100644 (file)
@@ -217,7 +217,6 @@ static void     gtk_file_chooser_button_drag_data_received (GtkWidget        *wi
                                                            guint             type,
                                                            guint             drag_time);
 static void     gtk_file_chooser_button_show_all           (GtkWidget        *widget);
-static void     gtk_file_chooser_button_hide_all           (GtkWidget        *widget);
 static void     gtk_file_chooser_button_show               (GtkWidget        *widget);
 static void     gtk_file_chooser_button_hide               (GtkWidget        *widget);
 static void     gtk_file_chooser_button_map                (GtkWidget        *widget);
@@ -328,7 +327,6 @@ gtk_file_chooser_button_class_init (GtkFileChooserButtonClass * class)
   widget_class->destroy = gtk_file_chooser_button_destroy;
   widget_class->drag_data_received = gtk_file_chooser_button_drag_data_received;
   widget_class->show_all = gtk_file_chooser_button_show_all;
-  widget_class->hide_all = gtk_file_chooser_button_hide_all;
   widget_class->show = gtk_file_chooser_button_show;
   widget_class->hide = gtk_file_chooser_button_hide;
   widget_class->map = gtk_file_chooser_button_map;
@@ -1100,12 +1098,6 @@ gtk_file_chooser_button_show_all (GtkWidget *widget)
   gtk_widget_show (widget);
 }
 
-static void
-gtk_file_chooser_button_hide_all (GtkWidget *widget)
-{
-  gtk_widget_hide (widget);
-}
-
 static void
 gtk_file_chooser_button_show (GtkWidget *widget)
 {
index 068f2a338cb91769866edf08d1572741323e8b85..0199614b345a348b703c5670364ad8c3ce5b321f 100644 (file)
@@ -241,7 +241,6 @@ static void     gtk_menu_set_submenu_navigation_region (GtkMenu          *menu,
  
 static void gtk_menu_deactivate            (GtkMenuShell      *menu_shell);
 static void gtk_menu_show_all       (GtkWidget         *widget);
-static void gtk_menu_hide_all       (GtkWidget         *widget);
 static void gtk_menu_position       (GtkMenu           *menu);
 static void gtk_menu_reparent       (GtkMenu           *menu, 
                                     GtkWidget         *new_parent, 
@@ -479,7 +478,6 @@ gtk_menu_class_init (GtkMenuClass *class)
   widget_class->button_release_event = gtk_menu_button_release;
   widget_class->motion_notify_event = gtk_menu_motion_notify;
   widget_class->show_all = gtk_menu_show_all;
-  widget_class->hide_all = gtk_menu_hide_all;
   widget_class->enter_notify_event = gtk_menu_enter_notify;
   widget_class->leave_notify_event = gtk_menu_leave_notify;
   widget_class->style_set = gtk_menu_style_set;
@@ -5136,14 +5134,6 @@ gtk_menu_show_all (GtkWidget *widget)
   gtk_container_foreach (GTK_CONTAINER (widget), (GtkCallback) gtk_widget_show_all, NULL);
 }
 
-
-static void
-gtk_menu_hide_all (GtkWidget *widget)
-{
-  /* Hide children, but not self. */
-  gtk_container_foreach (GTK_CONTAINER (widget), (GtkCallback) gtk_widget_hide_all, NULL);
-}
-
 /**
  * gtk_menu_set_screen:
  * @menu: a #GtkMenu.
index 0deeda46e441706432358d55294094f8100552ac..d0dd5e9032a506c978419ac27a853ceb87cc74e7 100644 (file)
@@ -114,7 +114,6 @@ static void gtk_menu_item_position_menu  (GtkMenu          *menu,
                                          gboolean         *push_in,
                                          gpointer          user_data);
 static void gtk_menu_item_show_all       (GtkWidget        *widget);
-static void gtk_menu_item_hide_all       (GtkWidget        *widget);
 static void gtk_menu_item_forall         (GtkContainer    *container,
                                          gboolean         include_internals,
                                          GtkCallback      callback,
@@ -194,7 +193,6 @@ gtk_menu_item_class_init (GtkMenuItemClass *klass)
   widget_class->enter_notify_event = gtk_menu_item_enter;
   widget_class->leave_notify_event = gtk_menu_item_leave;
   widget_class->show_all = gtk_menu_item_show_all;
-  widget_class->hide_all = gtk_menu_item_hide_all;
   widget_class->mnemonic_activate = gtk_menu_item_mnemonic_activate;
   widget_class->parent_set = gtk_menu_item_parent_set;
   widget_class->can_activate_accel = gtk_menu_item_can_activate_accel;
@@ -2187,23 +2185,6 @@ gtk_menu_item_show_all (GtkWidget *widget)
   gtk_widget_show (widget);
 }
 
-static void
-gtk_menu_item_hide_all (GtkWidget *widget)
-{
-  GtkMenuItem *menu_item;
-
-  g_return_if_fail (GTK_IS_MENU_ITEM (widget));
-
-  gtk_widget_hide (widget);
-
-  menu_item = GTK_MENU_ITEM (widget);
-
-  /* hide children including submenu */
-  gtk_container_foreach (GTK_CONTAINER (widget), (GtkCallback) gtk_widget_hide_all, NULL);
-  if (menu_item->submenu)
-    gtk_widget_hide_all (menu_item->submenu);
-}
-
 static gboolean
 gtk_menu_item_can_activate_accel (GtkWidget *widget,
                                  guint      signal_id)
index 7389a7e0dcea44192e615193d4ccf0c51032f9e5..a9b5b7457de1cfc1272ef12c43a72c88096d39db 100644 (file)
@@ -204,11 +204,9 @@ gtk_socket_class_init (GtkSocketClass *class)
   widget_class->key_release_event = gtk_socket_key_event;
   widget_class->focus = gtk_socket_focus;
 
-  /* We don't want to show_all/hide_all the in-process
-   * plug, if any.
+  /* We don't want to show_all the in-process plug, if any.
    */
   widget_class->show_all = gtk_widget_show;
-  widget_class->hide_all = gtk_widget_hide;
   
   container_class->remove = gtk_socket_remove;
   container_class->forall = gtk_socket_forall;
index 7281544ccee66ff503ebee418303eaff956724f8..87b180f99982d7ac4d5bfb3ee7a4ed8d2e76a16b 100644 (file)
@@ -212,7 +212,6 @@ static void       gtk_toolbar_get_child_property   (GtkContainer        *contain
                                                    GParamSpec          *pspec);
 static void       gtk_toolbar_finalize             (GObject             *object);
 static void       gtk_toolbar_show_all             (GtkWidget           *widget);
-static void       gtk_toolbar_hide_all             (GtkWidget           *widget);
 static void       gtk_toolbar_add                  (GtkContainer        *container,
                                                    GtkWidget           *widget);
 static void       gtk_toolbar_remove               (GtkContainer        *container,
@@ -296,7 +295,6 @@ static GtkWidget *     toolbar_content_retrieve_menu_item   (ToolbarContent
 static gboolean        toolbar_content_has_proxy_menu_item  (ToolbarContent     *content);
 static gboolean        toolbar_content_is_separator         (ToolbarContent      *content);
 static void            toolbar_content_show_all             (ToolbarContent      *content);
-static void            toolbar_content_hide_all             (ToolbarContent      *content);
 static void           toolbar_content_set_expand           (ToolbarContent      *content,
                                                             gboolean             expand);
 
@@ -384,7 +382,6 @@ gtk_toolbar_class_init (GtkToolbarClass *klass)
   widget_class->unmap = gtk_toolbar_unmap;
   widget_class->popup_menu = gtk_toolbar_popup_menu;
   widget_class->show_all = gtk_toolbar_show_all;
-  widget_class->hide_all = gtk_toolbar_hide_all;
   
   container_class->add    = gtk_toolbar_add;
   container_class->remove = gtk_toolbar_remove;
@@ -2442,23 +2439,6 @@ gtk_toolbar_show_all (GtkWidget *widget)
   gtk_widget_show (widget);
 }
 
-static void
-gtk_toolbar_hide_all (GtkWidget *widget)
-{
-  GtkToolbar *toolbar = GTK_TOOLBAR (widget);
-  GtkToolbarPrivate *priv = toolbar->priv;
-  GList *list;
-
-  for (list = priv->content; list != NULL; list = list->next)
-    {
-      ToolbarContent *content = list->data;
-      
-      toolbar_content_hide_all (content);
-    }
-
-  gtk_widget_hide (widget);
-}
-
 static void
 gtk_toolbar_add (GtkContainer *container,
                 GtkWidget    *widget)
@@ -3567,16 +3547,6 @@ toolbar_content_show_all (ToolbarContent  *content)
     gtk_widget_show_all (widget);
 }
 
-static void
-toolbar_content_hide_all (ToolbarContent  *content)
-{
-  GtkWidget *widget;
-  
-  widget = toolbar_content_get_widget (content);
-  if (widget)
-    gtk_widget_hide_all (widget);
-}
-
 /*
  * Getters
  */
index ca53772936a7abbdcfe3f4caec6b450d3decd815..38fab006bbcae7de107ad0aa6e0ce778bf72f21f 100644 (file)
@@ -746,7 +746,6 @@ gtk_widget_class_init (GtkWidgetClass *klass)
   klass->show = gtk_widget_real_show;
   klass->show_all = gtk_widget_show;
   klass->hide = gtk_widget_real_hide;
-  klass->hide_all = gtk_widget_hide;
   klass->map = gtk_widget_real_map;
   klass->unmap = gtk_widget_real_unmap;
   klass->realize = gtk_widget_real_realize;
@@ -3972,28 +3971,6 @@ gtk_widget_show_all (GtkWidget *widget)
     class->show_all (widget);
 }
 
-/**
- * gtk_widget_hide_all:
- * @widget: a #GtkWidget
- * 
- * Recursively hides a widget and any child widgets.
- **/
-void
-gtk_widget_hide_all (GtkWidget *widget)
-{
-  GtkWidgetClass *class;
-
-  g_return_if_fail (GTK_IS_WIDGET (widget));
-
-  if (gtk_widget_get_no_show_all (widget))
-    return;
-
-  class = GTK_WIDGET_GET_CLASS (widget);
-
-  if (class->hide_all)
-    class->hide_all (widget);
-}
-
 /**
  * gtk_widget_map:
  * @widget: a #GtkWidget
@@ -12503,11 +12480,11 @@ gtk_widget_remove_mnemonic_label (GtkWidget *widget,
 /**
  * gtk_widget_get_no_show_all:
  * @widget: a #GtkWidget
- * 
- * Returns the current value of the GtkWidget:no-show-all property, 
- * which determines whether calls to gtk_widget_show_all() and 
- * gtk_widget_hide_all() will affect this widget. 
- * 
+ *
+ * Returns the current value of the GtkWidget:no-show-all property,
+ * which determines whether calls to gtk_widget_show_all()
+ * will affect this widget.
+ *
  * Return value: the current value of the "no-show-all" property.
  *
  * Since: 2.4
@@ -12516,7 +12493,7 @@ gboolean
 gtk_widget_get_no_show_all (GtkWidget *widget)
 {
   g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
-  
+
   return widget->priv->no_show_all;
 }
 
@@ -12524,10 +12501,9 @@ gtk_widget_get_no_show_all (GtkWidget *widget)
  * gtk_widget_set_no_show_all:
  * @widget: a #GtkWidget
  * @no_show_all: the new value for the "no-show-all" property
- * 
- * Sets the #GtkWidget:no-show-all property, which determines whether 
- * calls to gtk_widget_show_all() and gtk_widget_hide_all() will affect 
- * this widget. 
+ *
+ * Sets the #GtkWidget:no-show-all property, which determines whether
+ * calls to gtk_widget_show_all() will affect this widget.
  *
  * This is mostly for use in constructing widget hierarchies with externally
  * controlled visibility, see #GtkUIManager.
index e576ae6b1cb34e41c8bd93ada475451b445a5ff9..0d8859111d615f195f3a57b499f02fb8514d8995 100644 (file)
@@ -183,7 +183,6 @@ struct _GtkWidgetClass
   void (* show)                       (GtkWidget        *widget);
   void (* show_all)            (GtkWidget        *widget);
   void (* hide)                       (GtkWidget        *widget);
-  void (* hide_all)            (GtkWidget        *widget);
   void (* map)                (GtkWidget        *widget);
   void (* unmap)              (GtkWidget        *widget);
   void (* realize)            (GtkWidget        *widget);
@@ -416,13 +415,12 @@ void         gtk_widget_destroy             (GtkWidget           *widget);
 void      gtk_widget_destroyed           (GtkWidget           *widget,
                                           GtkWidget          **widget_pointer);
 void      gtk_widget_unparent            (GtkWidget           *widget);
-void      gtk_widget_show                (GtkWidget           *widget);
+void       gtk_widget_show                (GtkWidget           *widget);
+void       gtk_widget_hide                (GtkWidget           *widget);
 void       gtk_widget_show_now            (GtkWidget           *widget);
-void      gtk_widget_hide                (GtkWidget           *widget);
-void      gtk_widget_show_all            (GtkWidget           *widget);
-void      gtk_widget_hide_all            (GtkWidget           *widget);
+void       gtk_widget_show_all            (GtkWidget           *widget);
 void       gtk_widget_set_no_show_all     (GtkWidget           *widget,
-                                          gboolean             no_show_all);
+                                           gboolean             no_show_all);
 gboolean   gtk_widget_get_no_show_all     (GtkWidget           *widget);
 void      gtk_widget_map                 (GtkWidget           *widget);
 void      gtk_widget_unmap               (GtkWidget           *widget);